<template>
  <div class="con">
    <van-tabs type="card" v-model="n" color="#ff4400">
      <van-tab v-for="item in navs" :key="item.id" :title="item">
          <good-list v-if="arr.length>0" :arr="arr[n].content" ></good-list>
      </van-tab>
    </van-tabs>
  </div>
</template>

<script>

import { reqHomeGoods } from "../../../http/http";
export default {
  data() {
    return {
      navs:["热门推荐","上新推荐","所有商品"],
      arr: [],
      n:0
    };
  },
  mounted() {
    reqHomeGoods(this.$route.query.id).then((res) => {
      // console.log(res);
      this.arr = res.data.list?res.data.list:[];
    });
  },
};
</script>

<style scoped>
.con{
  margin-top: 0.1rem;
  padding-bottom: 0.9rem;
}
</style>